package prototype.example;

/**
 * 需要实现拷贝的类必须实现Cloneable标识接口
 * @author Chen Guang
 * @date 2019/4/8 0008 下午 14:21
 */
public class Resume implements Cloneable{

    private String name;
    private String sex;
    private int age;
    private String timeArea;
    private Company company;
    private Integer salary;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public Resume(String name) {
        this.name = name;
    }

    /**
     * 设置个人信息
     * @param age 年龄
     * @param sex 性别
     */
    public void  setPersonalInfo(int age, String sex){
        this.age = age;
        this.sex = sex;
    }

    /**
     * 设置工作经验
     * @param timeArea 年龄
     * @param company 性别
     */
    public void  setWorkExperience(String timeArea, Company company) {
        this.timeArea = timeArea;
        this.company = company;
    }

    @Override
    public String toString() {
        return "Resume{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", timeArea='" + timeArea + '\'' +
                ", company='" + company + '\'' +
                ", salary=" + salary +
                '}';
    }

    public Integer getSalary() {
        return salary;
    }

    public void setSalary(Integer salary) {
        this.salary = salary;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }
}
